package exception;

/**
 * @description: TODO
 * @author yumo
 * @version: 1.0
 * @date 2025/3/15 15:45
 */
public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println(test("a")+","+test(null)+","+test(""));


    }
    public static int test(String str){
        try{

            System.out.println(str.charAt(7));
        }catch (StringIndexOutOfBoundsException e){
            return 1;
        }catch (Exception e){
            return 2;
        }finally {
            return 3;
        }
    }
}
